const routesArr =[
  // {
  //   key:"Editor",
  //   name:'富文本编辑器',
  //   path:'/Editor',
  //   icon:"mail"
  // },
  {
      key:"user",
      name:'用户',
      icon:"user",
      children:[{
        key:"ServerMana",
          name:"服务与动作管理",
          path:"/ServerMana",
          // icon:"mail"
      },{
        key:"demo5",
        name:"角色管理",
        path:"/demo4",
        // icon:"mail"
      },{
        key:"userlist",
        name:"用户列表",
        path:"/Userlist",
        // icon:"team"
      },{
        key:"institution",
        name:"组织机构",
        path:"/Institution",
        // icon:"mail"
      }],
  },{
    key:"link",
    name:'友链',
    icon:"link",
    children:[{
        key:"homelink",
        name:"首页友链",
        path:"/Link",
    }],
  },{
    key:"base",
    name:'基础信息管理',
    icon:"database",
    children:[{
        key:"state",
        name:"国家地区管理",
        path:"/State",
    },{
      key:"school",
      name:"学校管理",
      path:"/School",
    },{
      key:"industry",
      name:"行业管理",
      path:"/Industry",
    },{
      key:"xingqu",
      name:"兴趣管理",
      path:"/Xingqu",
    }],
  },{
    key:"system",
    name:'系统管理',
    icon:"laptop",
    children:[{
        key:"state",
        name:"系统配置",
        path:"/State",
    },{
      key:"school",
      name:"敏感词管理",
      path:"/School",
    },{
      key:"industry",
      name:"关键词管理",
      path:"/Industry",
    },{
      key:"xingqu",
      name:"统计信息",
      path:"/Xingqu",
    }],
  },
  ]

  let routesJson = {}
  const getRoutesJson =(routesArr)=>{
    routesArr.map((item) => {
          if(!item.children){
              routesJson[item.key] = item.name
         }else{
          getRoutesJson(item.children)
          }
      })
      return routesJson
  }
  getRoutesJson(routesArr)
module.exports = {
    routesArr,
    routesJson
}